
'''

字典:用大括号包裹的键值对的集合
'''

# dict1 = {1:'张三',2:'李四','teacher':'王国栋','info':["email"]}
# print(dict1)
# dict2 = {'jack':100,'tom':90,'lily':99,'lucy':90}
# dict3 = {}
# print(type(dict3))
#
# star = ['杨幂','王静坤','佟丽娅','赵丽颖']
# star_dict={}
# star_dict = star_dict.fromkeys(star,100)
# print(star_dict)
#
# # print (star_dict['冯绍峰'])
# print (star_dict.get ('赵丽颖','您查找的内容不在'))
#
# star_dict['林志玲'] = 65
#
# print(star_dict)
# star_dict['林志玲'] = 85
# print(star_dict)
dict1 = {'杨幂': 100, '王静坤': 100, '佟丽娅': 100, '赵丽颖': 100}
# dict2 = {'jack':100,'tom':90,'lily':99,'lucy':90,'tom':190,'jack':120,'佟丽娅': 60}
print (dict1)
# keys = list(dict1.keys ())
# print (keys)
# values = dict1.values()
# print(values)
items = dict1.items()
print(items)
# # print (dict2)
#
# # dict1.update(dict2)
# # print (dict1)
# # print (dict2)
# dict1.setdefault('林志玲',10000) ##什么也没干
# print (dict1)
# # del dict1['林志玲']
# result = dict1.pop('赵本山','人家都是女明星,你凑啥热闹') #这个操作会返回一个结果
# print (dict1)
# print(result)